package main

import (
	"github.com/pelletier/go-toml"
	"log"
)

func main() {

	configPath := "server.toml"
	config, err := toml.LoadFile(configPath)
	if err != nil {
		log.Fatalf("Load configuration failed: %s", err)
	}
	/**
	启动 client模式
	*/
	go func() {

		if c, ok := config.Get("client").(*toml.Tree); ok {
			launchClient(c)
		}
	}()

	go func() {
		if s, ok := config.Get("server").(*toml.Tree); ok {
			launchServer(s)
		}
	}()

	select {}
}
